package com.im.common.enums.command;

/**
 * 系统命令枚举
 */
public enum SystemCommand implements Command {

    PING(0x270f, "心跳"),
    LOGIN(0x2328, "登录"),
    LOGINACK(0x2329, "登录ack"),
    LOGOUT(0x232b, "登出"),
    MUTUALLOGIN(0x232a, "下线通知，用于多端互斥");

    private int command;
    private String msg;

    /**
     * 构造函数
     *
     * @param command 命令值
     * @param desc     命令描述
     */
    SystemCommand(int command, String desc) {
        this.command = command;
        this.msg = desc;
    }

    /**
     * 获取命令值
     *
     * @return 命令值
     */
    @Override
    public int getCommand() {
        return command;
    }

    /**
     * 获取命令描述
     *
     * @return 命令描述
     */
    public String getDesc() {
        return msg;
    }
}